package com.voute.Model.Impl;

import com.voute.Api.ResetPasswordService;
import com.voute.Model.Bean.BaseBean;
import com.voute.Model.IResetPasswordModel;
import com.voute.Utils.ServiceFactory;

import java.util.HashMap;

import rx.Observable;

/**
 * 重置密码model实现类
 * Created by liucxu on 2017/2/14.
 */

public class ResetPasswordModelImpl implements IResetPasswordModel {

    @Override
    public Observable<BaseBean> getSMSCode(String phone, String uxtag) {
        HashMap<String,String> params=new HashMap<>();
        params.put("phone",phone);
        params.put("uxtag",uxtag);
        params.put("stype","valid");
        return ServiceFactory.GetInstance().createService(ResetPasswordService.class).getSMSCode(params);
    }

    @Override
    public Observable<BaseBean> resetPassword(String sms_code, String password, String phone, String uxtag) {
        HashMap<String,String> params=new HashMap<>();
        params.put("sms",sms_code);
        params.put("password",password);
        params.put("uxtag",uxtag);
        params.put("phone",phone);
        return ServiceFactory.GetInstance().createService(ResetPasswordService.class).resetPassword(params);
    }
}
